package org.icrisat.ismab.database;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnection {
	
	public Connection connection(){
		Connection con = null;
		/*String driver = "com.mysql.jdbc.Driver";
		String URL = "jdbc:mysql://localhost:3306/ismab";
		//String dbName = "ismab";		
		String userName = "root";
		String password = "bioinfo";*/
		
		String driver = "org.postgresql.Driver";
		String URL = "jdbc:postgresql://localhost:5432/ISMAB";
		//String dbName = "ismab";		
		String userName = "postgres";
		String password = "postgres";
		
		try{
			Class.forName(driver);
			con = DriverManager.getConnection(URL,userName,password);
			
			//System.out.println("Database connected");
			
			//con.close();
		}catch(Exception e){
			e.printStackTrace();			
		}
		return con;
	}
	
	
}